Bar = Class.extend({
	
	init: function(context, image) {
		this.healthImg = image;
		this.context = context;
		this.positionHealth = [550, 505, 455, 400, 340, 285, 235, 180, 120, 60, 0];
		
	},
	
	initHealthBar: function(shooted) {
		this.shooted = shooted;
		var j ;
		for (var i = 1; i <= this.positionHealth.length; i++) {
			if (this.shooted === i) {
				j = this.shooted - 1;
			}
		}
		this.clear();
		this.context.drawImage(this.healthImg[18], 

                                    this.positionHealth[j], 0,     //ot kude da pokazva image
                                    40, 600,                       //kolko ot image da pokazva
                                    990, -35,                       //nachalna poziciq
                                    25, 300);                      //golemina

	},
		
	clear: function() {
		this.context.clearRect(970, 40, 40, 400);		
	}
		
});
